/**
 * @file   socket.h
 * @author Pedro
 * @date   Thu Nov  6 12:15:19 2008
 * 
 * @brief  Comunicación entre hosts.
 * 
 * 
 */

#ifndef _SOCKETS_H_
#define _SOCKETS_H_

typedef struct socket_params_t{
    char ipaddress[30];
    int port;
    bool quit;
    pthread_t hiloserver;
    pthread_t hiloclient;
    bool master_is_grab;
    bool master_is_active;
    bool (*callback)(socket_params_t *, void *);
    void *callback_params;
} socket_params_t;

typedef socket_params_t socket_client_params_t;

socket_params_t * init_master_socket(const char * ipadderss, int port);
socket_params_t * init_slave_socket(int port) ;
socket_params_t * finish_slave_socket(socket_params_t * socket_params);
socket_params_t * finish_master_socket(socket_params_t * socket_params);



#endif
